package pers.chao.boxing;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import pers.chao.boxing.core.ResponseBoxingAspect;
import pers.chao.boxing.core.TimestampPlug;

/**
 * Description: 自动配置类
 *
 * @author W.Chao
 * @date 2020/10/31 18:14
 **/
@Configuration
@EnableConfigurationProperties({TimestampPlug.class})
public class ResponseBoxingAutoConfigure {
	@Bean
	@ConditionalOnMissingBean({ResponseBoxingAspect.class})
	public ResponseBoxingAspect responseBoxingAspect(TimestampPlug datetimeProperties) {
		return new ResponseBoxingAspect(datetimeProperties);
	}
}
